
import {hasToken} from "./utils/hasToken"
import router from 'umi/router';
export function render(oldRender: () => void) {
  console.log(hasToken(),6866666);
  
    if(hasToken()){
        oldRender();
    }else{
        router.push('/login')
        
        oldRender();
    }
}

export const dva = {
  config: {
    onError(err: ErrorEvent) {
      err.preventDefault();
      console.error(err.message);
    },
  },
};
